import numpy as np
import cv2


lower_blue = np.array([0,0,0])
upper_blue = np.array([170,255,46])
cap = cv2.VideoCapture(0)

while(True):
	ret, frame = cap.read()
	hsv   = cv2.cvtColor(frame,cv2.COLOR_BGR2HSV)
	mask  = cv2.inRange(hsv,lower_blue,upper_blue)
	gray  = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
	canny = cv2.Canny(gray, 30, 150)
	print "gray:",gray.size
	print "gray:",gray.shape
	print "gray:",type(gray)
	
	canny = np.uint8(np.absolute(canny))
	print "canny:",canny.size
	print "canny:",canny.shape
	print "canny:",type(canny)
	
	cv2.imshow('frame',frame)
	cv2.imshow("mask" ,mask )
	cv2.imshow("canny",canny)
	if cv2.waitKey(1) & 0xFF == ord('q'):
		break
cap.release()
cv2.destroyAllWindows()
